module.exports = app => {
  const mongoose = app.mongoose;
  const Schema = mongoose.Schema;

  const ConsumeOrdersSchema = new Schema({
    userName: { type: String, required: true },
    tell: { type: String, required: true },
    roleClass: { type: Number, required: true },
    // 消费项目 JSON
    orderArr: { type: String, required: true },
    price: { type: Number, required: true },
    desc: { type: String },
    // 订单操作者
    operation: { type: String, required: true },
    role: { type: Number, required: true },

    createTime: {
      type: Date,
      default: Date.now
    }
  });

  return mongoose.model('ConsumeOrders', ConsumeOrdersSchema);
}
